using System;

namespace Client
{
	public partial class Wait_Scan : Gtk.Dialog
	{
		private Controleur_Scan Ctrl_scan;
		
		public Wait_Scan ()
		{
			this.Build ();
			MoreInfo.Clicked += OnMoreInfoButton;
			Cancel.Clicked += OnCancelButton;
		}
		
		public void Info(string message) {
			Gtk.Application.Invoke (delegate {
				InfoText.LabelProp = message;
			});
		}
		
		protected virtual void OnMoreInfoButton (object obj, EventArgs args) {
			Ctrl_scan.ModeInfo();
			
			Gtk.Application.Invoke (delegate {
				if(MoreInfo.Label == "More Info")
					MoreInfo.Label = "Less Info";
				else
					MoreInfo.Label = "More Info";
			});
		}
		
		protected virtual void OnCancelButton (object obj, EventArgs args) {
			Ctrl_scan.Cancel();
		}
		
		public void AddControlleur(Controleur_Scan ctrl) {
			Ctrl_scan = ctrl;
		}
		
		
	}
}

